Repository navigation
Conversation
Contributor
Author
|
Closing: the API-key cache, widened upstream connection pools, and shutdown drain were reconciled onto the fork mainline. We are not pushing this to upstream in this round; it may later be split into a clean standalone PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Three hot paths in the gateway were paying a full SQLite write or a fresh TLS handshake per request, and a shutdown could stall behind long-lived streams with no drain window.
What changed
internal/auth/cache.go): configurable viaCLI2API_AUTH_CACHE_MS(0disables). Console key edits/deletions invalidate immediately, andlast_used_atis written at most once per minute instead of on every request.internal/netx/transport.go): 100 idle connections per host, five-minute bound on the response-head wait, so bursts reuse TLS connections and a silent upstream fails over instead of pinning a request forever.internal/app,internal/server):/readyreturns 503 and new work is rejected while active streams finish for up to 30 s;/healthexposes the draining state; compose waits 40 s before SIGKILL.All knobs default to the values above, so no behavior change unless the env vars are set.
Tests
go build ./...go test ./internal/server/ ./internal/executor/ ./internal/app/ ./internal/gateway/ ./internal/runtime/— all passinternal/auth/cache_test.go(TTL, invalidation, throttledlast_used_at),internal/netx/transport_test.go,internal/server/health_test.go(draining state).